package com.budwk.app.sqfwV2.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.budwk.app.sqfw.enums.SupportBusinessTypeEnum;
import com.budwk.app.sqfw.models.Sqfw_formSummary_new;
import com.budwk.app.sqfwV2.component.ShawenTownComponent;
import com.budwk.app.sqfwV2.dto.vo.JurisdictionShopQueryVo;
import com.budwk.app.sqfwV2.service.ShopsBaseInfoService;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.services.SysUserService;
import com.budwk.starter.common.openapi.annotation.ApiDefinition;
import com.budwk.starter.common.openapi.annotation.ApiOperation;
import com.budwk.starter.common.openapi.annotation.ApiResponses;
import com.budwk.starter.common.result.Result;
import com.budwk.starter.log.annotation.SLog;
import com.budwk.starter.security.utils.SecurityUtil;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.*;

/**
 * @author 东方祥云低代码1.1
 * @since 2024-03-11
 *
 * 沙文消防安全排查 ShawenTownSafety
 */
@IocBean
@At("/platform/sqfwV2/shopsInfo")
@ApiDefinition(tag = "商铺基本信息api")
@Slf4j
public class ShopsInfoController {

    @Inject
    private ShopsBaseInfoService shopsBaseInfoService;
    @Inject
    private SysUserService sysUserService;

    @At
    @Ok("json")
    @GET
    @ApiOperation(name = "商铺停业")
    @ApiResponses
    @SaCheckLogin
    public Result<?> changeCloseDown(@Param("shopId") String shopId) {
        shopsBaseInfoService.changeCloseDown(shopId);
        return Result.success();
    }

    /**
     * 根据当前登录人获取辖区商铺信息
     *
     * @return
     */
    @At
    @Ok("json")
    @POST
    @ApiOperation(name = "辖区商铺信息")
    @ApiResponses
    @SLog(tag = "辖区商铺信息", value = "")
    @SaCheckLogin
    public Result<?> listJurisdictionShop(JurisdictionShopQueryVo queryVo) {
        return shopsBaseInfoService.listJurisdictionShop(queryVo);
    }

    @At
    @Ok("json")
    @GET
    @ApiOperation(name = "查询商铺详情信息")
    @ApiResponses(implementation = Sqfw_formSummary_new.class)
    @SaCheckLogin
    public Result<?> getShopDetailById(@Param("shopId") String shopId) {
        Sqfw_formSummary_new formSummaryNew = shopsBaseInfoService.getShopDetailById(shopId);
        return Result.data(formSummaryNew);
    }
}
